﻿<UserControl x:Class="Dsl.Ped.Desktop.Views.MainWindowView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:views="clr-namespace:Dsl.Ped.Desktop.Views"
             xmlns:themes="clr-namespace:AvalonDock.Themes;assembly=AvalonDock.Themes.Aero"
             xmlns:avalonDock="http://avalondock.codeplex.com" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
            <GradientStop Color="#FFFFFFFF" Offset="0" />
            <GradientStop Color="#FFC5D3F1" Offset="0.5" />
            <GradientStop Color="#FFFFFFFF" Offset="1" />
        </LinearGradientBrush>
    </UserControl.Background>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <views:RibbonBarView Grid.Row="0" Grid.Column="0"/>

        <avalonDock:DockingManager Grid.Row="1" Grid.Column="0" x:Name="avalonDock"
                                   AnchorablesSource="{Binding ModuleViewModels}">
            <avalonDock:DockingManager.Theme>
                <themes:AeroTheme/>
            </avalonDock:DockingManager.Theme>

            <avalonDock:DockingManager.LayoutItemTemplate>
                <DataTemplate>
                    <ContentControl Content="{Binding View}"/>
                </DataTemplate>
            </avalonDock:DockingManager.LayoutItemTemplate>

            <avalonDock:DockingManager.LayoutItemContainerStyle>
                <Style TargetType="{x:Type avalonDock:LayoutAnchorableItem}">
                    <Setter Property="Title" Value="{Binding Model.Title}"/>
                    <Setter Property="IconSource" Value="{Binding Model.IconSource}"/>
                    <Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/>
                    <Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
                    <Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
                    <Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
                </Style>
            </avalonDock:DockingManager.LayoutItemContainerStyle>
            
            <avalonDock:LayoutRoot>
                <avalonDock:LayoutPanel Orientation="Horizontal">
                    <avalonDock:LayoutAnchorablePane DockWidth="150">
                    </avalonDock:LayoutAnchorablePane>
                </avalonDock:LayoutPanel>
            </avalonDock:LayoutRoot>
        </avalonDock:DockingManager>
    </Grid>
</UserControl>
